#include <func.h>

#define MAXSIZE 256

int main(int argc, char* argv[])
{
	int fields[2];
	if (pipe(fields) == -1) {
		error(1, errno, "pipe");
	}
	
	printf("fields[0] = %d\n", fields[0]);
	printf("fields[1] = %d\n", fields[1]);

	write(fields[1], "Hello pipe!\n", 13);
	char message[MAXSIZE];
	read(fields[0], message, MAXSIZE);
	printf("message: %s", message);

    return 0;
}

